<template>
	<view>
		<view class="img" v-for="(item,index) in list" :key="index" @click="openDetail(item.id)">
			<image :src="item.thumb" style="height: 406rpx; width: 670rpx;"></image>
			<view class="mark">
				<text style="line-height:64rpx;width: 100%;text-align: center;">{{item.name}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			openDetail(id){
				uni.navigateTo({
					url:`/pages/detail/detail?id=${id}`
				})
			}
		},
		onLoad() {
			uni.request({
				url: 'https://baiyi.kent.work/api/v1/system/getConstructionList',
				method: 'POST',
				data: {
					"page": 1, //页码
					"limit": 10, //分页偏移量
				},
				success: res => {
					this.list = res.data.data.list
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style>
	.img {
		margin-top: 40rpx;
		display: flex;
		flex-direction: column;
		border-radius: 6rpx;
		align-items: center;
		justify-content: center;
	}

	.mark {
		background-color: white;
		height: 64rpx;
		width: 675rpx;
		border-radius: 8rpx;
		display: flex;
	}
</style>